package com.plian.system.controller.transfer;

import com.plian.system.model.R;
import com.plian.system.service.transfer.IBulletinTransferService;
import com.plian.system.vo.fr.bulletin.BulletinTransferVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping(value = "api/bulletintransfer")
@Api(value = "快报数据对接", tags = "快报数据对接")
public class BulletinTransferController {

    @Autowired
    private IBulletinTransferService bulletinTransferService;

    @PostMapping(value = "/submit")
    @ApiOperation(value = "快报数据 单个", notes = "传入bulletinTransferVO")
    public R submit(@RequestBody BulletinTransferVO bulletinTransferVO){
        return R.status(bulletinTransferService.submit(bulletinTransferVO));
    }

    @PostMapping(value = "/submit-list")
    @ApiOperation(value = "快报数据 批量", notes = "传入bulletinTransferVO")
    public R submitList(@RequestBody List<BulletinTransferVO> bulletinTransferVOS){
        return R.status(bulletinTransferService.submitList(bulletinTransferVOS));
    }
}
